using Paradogs2.api;
using UnityEngine;

namespace Paradogs2
{
    [System.Serializable]
    public class ConfigData
    {
        // 登录服地址
        public string login_server_url;
    }

    public class PD2SdkContext
    {
        public static ConfigData config;
        public static OwnerSyncData owner;

        static PD2SdkContext()
        {
            // 加载全局配置
            TextAsset configAsset = Resources.Load<TextAsset>("pd2_sdk_config");
            if (configAsset != null)
            {
                config = JsonUtility.FromJson<ConfigData>(configAsset.text);
            }
            else
            {
                throw new System.Exception("pd2_sdk_config.json not found | try find Assets/pd2-sdk/Resources/pd2_sdk_config.json");
            }
        }

        // public static void watch(OwnerSyncData owner)
        // {
        //
        // }
    }

}